# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-rich-click
pkgver=1.7.1
pkgrel=0
pkgdesc="Format click help output nicely with rich"
url="https://github.com/ewels/rich-click"
arch="noarch"
license="MIT"
depends="
	py3-click
	py3-rich
	py3-typing-extensions
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ewels/rich-click/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/rich-click-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1ec59fea129263a709ffa2b686089cd0c4098b92f5b731aa2c2b1fcdef07cfd92723b9727ac76a46a5c528863867825864b9383f0f9d7f96b7c26f5b37ba5228  py3-rich-click-1.7.1.tar.gz
"
